<?php

/**
 * AlquileresDisponibilidad filter form base class.
 *
 * @package    costabravasfr
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseAlquileresDisponibilidadFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'fecha_fin'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'familia'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'pais'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'precio_euros_sistema' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'fecha_fin'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'familia'              => new sfValidatorPass(array('required' => false)),
      'pais'                 => new sfValidatorPass(array('required' => false)),
      'precio_euros_sistema' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('alquileres_disponibilidad_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AlquileresDisponibilidad';
  }

  public function getFields()
  {
    return array(
      'nombre'               => 'Text',
      'fecha_inicio'         => 'Date',
      'fecha_fin'            => 'Date',
      'familia'              => 'Text',
      'pais'                 => 'Text',
      'precio_euros_sistema' => 'Number',
    );
  }
}
